<template>
  <div class="twoBox">
    <div class="activityData" >
      <ex-table ref="table" :loading="loading" :table-column="tableColumn" :table-data="tableData"
        @pageSizeChange="handleSizeChange" @currentPageChange="handleCurrentChange">
      </ex-table>
    </div>
  </div>
</template>
<script>
import {
  rankList
} from '@/api/blindBox/quizConfigOne'

import handlePageMixin from "@/mixins/handlePageMixin";
export default {
  name: "shopDetail",
  components: {
    
  },
  props: {
  },
  mixins: [handlePageMixin],
  data() {
    return {
     
      tableData:[],
      recordTypeList: [
        {id: '',value: '全部'},
        {id: '1',value: '不可转赠'},
        {id: '2',value: '可转赠'},
      ],
      total: 0,
      id: '',
      queryParams: {
        guessActivityId: '',
      },
      configValue: '',
      tableColumn: [{
            prop: "customerName",
            label: "姓名"
          },
          {
            prop: "customerPhone",
            label: "手机号",
          },
          {
            prop: "num",
            label: "竞猜成功数"
          },
        ],
    };
  },
  watch: {
   
  },
  created() {
    this.queryParams.guessActivityId = this.$route.query.guessActivityId
    this.getList()
    this.getdonationShow()
  },
  mounted() {
  
  },
  methods: {
     search() {
        //搜索
 
        this.pageOptions.pageNum = 1;
        this.$refs.table.pageOptions.pageNum = 1;
        this.getList();
      },
      reset() {
        this.date = [];
        this.pageOptions.pageNum = 1;
        this.$refs.table.pageOptions.pageNum = 1;
        this.getList();
      },
    /** 查询盲盒开奖名单*/
    getList() {
      this.loading = true;
      var data = {
        ...this.pageOptions,
        ...this.queryParams,
      }
      rankList(data).then(response => {
        const {records ,total} = response.result
        console.log('response',response)
        this.tableData = records
        this.$refs.table.pageOptions.total = total;
        this.tableData = this.tableData.map(item => {
          // console.log('item',item)
          Object.keys(item).forEach(key => {
            if (item[key] === '') {
              item[key] = '--'

            }
          })
          return item
        })
        this.total = total
        this.loading = false;
      });
    },
  
    handleConfiguration(row){
      this.configurationVisible = true
    },
    _handleSuccess(){
      this.getList()
    },
  },
};
</script>
<style lang="scss" scoped>
.btnBox{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
</style>
